import {defHttp} from "@/utils/http/axios";

export function geAdminUserList(param) {
  const { page = 1, pageSize = 10, search = '' } = param;
  return defHttp.get({url: `/admin/user/${page}/${pageSize}${search ? '?' + search : ''}`});
}

export function createAdminUser(data) {
  return defHttp.post({url: `/admin/user`, data});
}

export function updateAdminUser(data) {
  const { id } = data
  return defHttp.put({url: `/admin/user/${id}`, data});
}

export function changePassword(data) {
  const { id } = data
  return defHttp.put({url: `/changePassword/${id}`, data});
}

export function deleteAdminUser(data) {
  const { id } = data
  return defHttp.delete({url: `/admin/user/${id}`});
}
